<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

function createCoupon($couponid,$serviceName) {
    	$image = ImageCreateFromPNG('img/coupon.png');
    	$white = ImageColorAllocate($image, 255, 255, 255); 
	    $black = ImageColorAllocate($image, 0, 0, 0); 
	    $grey = ImageColorAllocate($image, 204, 204, 204); 

	    
	    ImageFill($image, 0, 0, $black); 

	    
	     
	    $height = 432;
	    $width = 650;
	    
	    imageline($image, 400, 300,600, 300, $grey); 
	    ImageString($image, 4, 400, 280, $couponid, $white);
	    imageline($image, 400, 350,600, 350, $grey); 
	    ImageString($image, 4, 400, 330, $serviceName, $white);
    	header("Content-Type: image/png");
    	ImagePNG($image); 
    	

    }